<?php
!function_exists('adminmsg') && exit('Forbidden');
$basename="$admin_file?adminjob=setads";

if($action!='submit'){
	${'ads_'.$db_ads}='checked';
	include PrintEot('setads');
} elseif($_POST['action']=="submit"){
	InitGP(array('ads'),'P');
	$rt=$db->get_one("SELECT db_name FROM pw_config WHERE db_name='db_ads'");
	if($rt['db_name']){
		$db->update("UPDATE pw_config SET db_value=".pwEscape($ads)."WHERE db_name='db_ads'");
	} else{
		$db->update("INSERT INTO pw_config SET db_name='db_ads',db_value=".pwEscape($ads));
	}
	updatecache_c();
	adminmsg('operate_success');
}
?>